const app = getApp()

Component({
    properties:{
      list:Object,
      isBaner:Boolean,
      type:String,
      userStatus:Object,
      goods:Object,
      showbutton:Boolean,
    },
    data:{
      lista: ['../../../images/1.jpg','../../../images/2.jpg'],
      background: [],
      isIndicator: true,
      isAuto: true,
      current: 0,
      circular: false,
        heizhi:320,
        heizhi11:320,
         swiperCurrent: 0,
         slider:[],
    },
    ready(){
  
        this.setData({
              heizhi11:app.globalData.screenWidth,
            heizhi:app.globalData.screenWidth*2
        })

         console.log(app.globalData.screenWidth);

     },
    methods: { 
        swiperChange: function(e){
            this.setData({
                swiperCurrent: e.detail.current
            })
        },
        clickD:function(){
            wx.navigateTo({
                url: '../DuanZhang/index',
              
            })
        },
        clickLogin:function(){
            wx.navigateTo({
                url: '../login/index',
              
            })
        },

        clikcdes: function(e) {
             let item = e.currentTarget.dataset.item;
                let i = item['busiNo'];
        if(i == null){
            return 
        }
        if(item.busiType == '109602'){
                wx.navigateTo({
                    url: '../DetailData/index',
                    success: function(res) {
                        // 通过eventChannel向被打开页面传送数据
                        res.eventChannel.emit('acceptDataFromOpenerPage', {
                            data: i
                        })
                    }
                })
                }else{
                    let str = {
                        'skuNo': i
                    };
                  
                    wx.navigateTo({
                        url: '../shopDetail/index',
                        success: function(res) {
                            // 通过eventChannel向被打开页面传送数据
                            res.eventChannel.emit('acceptDataFromOpenerPage', {
                                data: str
                            })
                        }
                    })
                }
       },
       
   }     
})
